;
import TrackPlayer,{Event,useTrackPlayerEvents} from "react-native-track-player";


const events = [Event.PlaybackState,Event.PlaybackError,Event.PlaybackActiveTrackChanged]

export const useLogTrackPlayerState = () => {
    useTrackPlayerEvents(events, async (event) => {
        const type = event.type;
        switch (type) {
            case Event.PlaybackState:
                console.warn('PlaybackState',event.state)
            break
            case Event.PlaybackError:
                console.warn('An error occurred',event )
            break
            case Event.PlaybackActiveTrackChanged:
                console.warn('PlaybackActiveTrackChanged',event.index )
            break
        }

    })
};
